//
//  AlreadyVerfifyVC.m
//  BrushFace
//
//  Created by timer_q on 15/12/15.
//  Copyright © 2015年 Zzz. All rights reserved.
//

#import "AlreadyVerfifyVC.h"

@interface AlreadyVerfifyVC ()

@end

@implementation AlreadyVerfifyVC

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
    [self.navBar setTitle:@"已认证"];
    [self.navBar setLeftBtn:NAV_BAR_LEFT_BTN_TYPE_BLUE];
    NSString *requestStr = [NSString stringWithFormat:@"%@/user/getuserInfo.json",SERVICE_ADRESS];
    AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager];
    manager.responseSerializer = [[AFHTTPResponseSerializer alloc] init];
    [manager GET:requestStr parameters:nil success:^(AFHTTPRequestOperation * _Nonnull operation, id  _Nonnull responseObject) {
        NSDictionary *jsondict = [NSJSONSerialization JSONObjectWithData:operation.responseData options:0 error:nil];
        NSString *fullname = jsondict[@"fullname"];
        NSString *certcode = [NSString stringWithFormat:@"%@",jsondict[@"certcode"]];
        NSString *firstcode = [certcode substringWithRange:NSMakeRange(0, 1)];
        NSString *lastcode = [certcode substringWithRange:NSMakeRange(certcode.length-1, 1)];
        NSMutableString *appendStr = [[NSMutableString alloc] init];
        for (int i=1; i<fullname.length; i++) {
            [appendStr appendString:@"*"];
        }
        [appendStr appendString:[fullname substringWithRange:NSMakeRange(fullname.length-1, 1)]];
        self.nameLabel.text = [NSString stringWithFormat:@"%@",appendStr];
        self.numLabel.text = [NSString stringWithFormat:@"%@****************%@",firstcode,lastcode];
    } failure:^(AFHTTPRequestOperation * _Nullable operation, NSError * _Nonnull error) {
        
    }];
    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
